{% block sw_condition_value_content %}
<div
    class="sw-condition-generic"
    :class="conditionValueClasses"
>
    {% block sw_condition_generic_field_operator %}
    <sw-condition-operator-select
        v-if="operators"
        v-bind="{ operators, condition }"
        :plural="matchesAll"
        :disabled="isDisabled || undefined"
    />
    {% endblock %}

    {% block sw_condition_generic_fields %}
    <template v-if="operator !== 'empty'">
        <template
            v-for="(field, index) in config.fields"
            :key="index"
        >
            <div class="sw-condition-generic__input-wrapper">
                <sw-form-field-renderer
                    v-bind="getBind(field)"
                    :disabled="isDisabled || undefined"
                    :value="getVisibleValue(field.name)"
                    size="medium"
                    show-clearable-button
                    :placeholder="getPlaceholder(field.type)"
                    @update:value="updateFieldValue(field.name, $event, baseUnit, selectedUnit)"
                />

                <sw-condition-unit-menu
                    v-if="field.config.unit"
                    :type="field.config.unit"
                    :value="values[field.name]"
                    :visible-value="getVisibleValue(field.name)"
                    class="sw-condition-generic__unit-menu"
                    @change-unit="handleUnitChange"
                    @set-default-unit="setDefaultUnit"
                />
            </div>
        </template>
    </template>
    {% endblock %}
</div>
{% endblock %}
